<template>
  <edit-dialog :centerDialogVisible="visible" :tilte="title" width="600" @Cancel="visible=false" @Submit="handleSubmit">
    <template #content>
      <el-form :model="form" ref="applyApproveFormRef" class="upload-approve-form">

      </el-form>
    </template>
  </edit-dialog>
</template>

<script>
import EditDialog from "@/components/editDialog/index.vue";
import ApplyApproveUploadFile from "@/views/construction/project-application/review-components/ApplyApproveUploadFile";
import {ApplyApproveType} from "@/views/construction/project-application/projectUtil";
import {approveBeforeProjectStart} from "@/api/construction-project/projectManage";
import store from "@/store";

export default {
  name: "ApplyApproveDialog",
  components: {ApplyApproveUploadFile, EditDialog},
  props: {
    options: {
      type: Object,
      default: () => ({})
    }
  },
  inject: ["options"],
  data() {
    return {
      visible: false,
      form: {
        type: Object,
        default: () => ({
          exeContent: {
            files: [],
            formContent: {}
          },
        })
      },
      title: '窗口',
      formType: undefined,
      ApplyApproveType,
    }
  },
  computed: {
    userInfo() {
      return store.state.user.userInfo
    },
  },
  methods: {
    open({row, title, formType, resolve}) {
      this.visible = true
      this.title = title
      this.formType = formType
      this.resolve = resolve
      this.form = {
        status: 1,
        approver: {
          id: this.userInfo.userId,
          name: this.userInfo.name,
          organId: this.userInfo.organId,
          organName: this.userInfo.organName,
        },
        projectId: row.id,
        change: false,
        exeContent: {
          files: [],
          formContent: {}
        },
      }
    },
    handleSubmit() {
      let that = this
      that.$refs.applyApproveFormRef.validate(valid => {
        if (valid) {

        }
      })
    },
  }
}
</script>

<style lang="less" scoped>
.upload-approve-form {

}
</style>
